<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>008-原型链.html</title>
</head>
<body>
	
</body>
<script>
	function Person(name,age){
		this.name = name;
		this.age = age;
	}
	Person.prototype.showName = function(){
		console.log("I am"+this.name);
	}
	Person.prototype.showAge = function(){
		console.log("I am"+this.age+"years old");
	}

	var p1 = new Person("chris",22);
	var p2 = new Person("vincent",24);

	p1.showName = function(){
		console.log('I am'+ this.name+'!!!');
	}
	console.log(p1);
	p1.showName();
	p1.showAge();
	console.log(p1.toString());
</script>
</html>